Telegram Group & Telegram Channel
3. Determining variable type with type()

>> a=7
>>> type(a)
<class 'int'>

>>> b=7.7
>>> type(b)
<class 'float'>

>>> c="hello"
>>> type(c)
<class 'str'>

>>> d=[1,2,3]
>>> type(d)
<class 'list'>

>>> e=(1,2,3)
>>> type(e)
<class 'tuple'>

>>> f={1:"one",2:"two"}
>>> type(f)
<class 'dict'>

>>> g={1,2,3}
>>> type(g)
<class 'set'>

>>> i=True
>>> type(i)
<class 'bool'>





You can check what type of object is assigned to a variable using Python's built-in type() function. Common data types include:

int (for integer)
float
str (for string)
list
tuple
dict (for dictionary)
set
bool (for Boolean True/False)

@python_codes



tg-me.com/python_codes/6
Create:
Last Update:

3. Determining variable type with type()

>> a=7
>>> type(a)
<class 'int'>

>>> b=7.7
>>> type(b)
<class 'float'>

>>> c="hello"
>>> type(c)
<class 'str'>

>>> d=[1,2,3]
>>> type(d)
<class 'list'>

>>> e=(1,2,3)
>>> type(e)
<class 'tuple'>

>>> f={1:"one",2:"two"}
>>> type(f)
<class 'dict'>

>>> g={1,2,3}
>>> type(g)
<class 'set'>

>>> i=True
>>> type(i)
<class 'bool'>





You can check what type of object is assigned to a variable using Python's built-in type() function. Common data types include:

int (for integer)
float
str (for string)
list
tuple
dict (for dictionary)
set
bool (for Boolean True/False)

@python_codes

BY Python Codes


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_codes/6

View MORE
Open in Telegram


Python Codes Telegram | DID YOU KNOW?

Date: |

How Does Telegram Make Money?

Telegram is a free app and runs on donations. According to a blog on the telegram: We believe in fast and secure messaging that is also 100% free. Pavel Durov, who shares our vision, supplied Telegram with a generous donation, so we have quite enough money for the time being. If Telegram runs out, we will introduce non-essential paid options to support the infrastructure and finance developer salaries. But making profits will never be an end-goal for Telegram.

How Does Bitcoin Work?

Bitcoin is built on a distributed digital record called a blockchain. As the name implies, blockchain is a linked body of data, made up of units called blocks that contain information about each and every transaction, including date and time, total value, buyer and seller, and a unique identifying code for each exchange. Entries are strung together in chronological order, creating a digital chain of blocks. “Once a block is added to the blockchain, it becomes accessible to anyone who wishes to view it, acting as a public ledger of cryptocurrency transactions,” says Stacey Harris, consultant for Pelicoin, a network of cryptocurrency ATMs. Blockchain is decentralized, which means it’s not controlled by any one organization. “It’s like a Google Doc that anyone can work on,” says Buchi Okoro, CEO and co-founder of African cryptocurrency exchange Quidax. “Nobody owns it, but anyone who has a link can contribute to it. And as different people update it, your copy also gets updated.”

Python Codes from vn


Telegram Python Codes
FROM USA